package com.sfeir.client.view;

import com.google.gwt.canvas.client.Canvas;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.sfeir.canvas.activities.client.CanvasView;
import com.sfeir.client.util.Constants;

public class GamePanelViewImpl extends Composite implements CanvasView {

	private final Canvas canvas;

	public GamePanelViewImpl() {
		VerticalPanel panel = new VerticalPanel();
		this.canvas = Canvas.createIfSupported();
		this.canvas.setWidth(Constants.CANVAS_WIDTH + "px");
		this.canvas.setHeight(Constants.CANVAS_HEIGHT + "px");
		this.canvas.setCoordinateSpaceWidth(Constants.CANVAS_WIDTH);
		this.canvas.setCoordinateSpaceHeight(Constants.CANVAS_HEIGHT);
		panel.add(canvas);
		this.canvas.setTabIndex(1);
		initWidget(panel);
	}

	public Canvas getCanvas() {
		return canvas;
	}

}
